import Vue from 'vue'
const host = process.env.API_HOST

export const createAcount = (customerId, eid, acount, desc = '', pwd) => {
  return Vue.http.post(`${host}/m/admin/account`, { eid, acount, pwd, desc, customerId })
}


export const getCustomer = (customerId) => {
  return Vue.http.get(`${host}/customerinfo/${customerId}`)
}

export const updateCustomer = (customerId, form) => {
  return Vue.http.put(`${host}/customerinfo/${customerId}`, form)
}

export const onResetPwd = (eid, acount, pwd) => {
  return Vue.http.put(`${host}/m/admin/resetPwd`, { eid, acount, pwd })
}

export const selectAdminCount = (fuzzy = '', sctime = '', ectime = '') => {
  return Vue.http.get(`${host}/m/admin/count`, { params: { fuzzy, sctime, ectime } })
}

export const selectAdminList = (fuzzy = '', page = 1, pageSize = 10, sctime = '', ectime = '') => {
  return Vue.http.get(`${host}/m/admin/list`, { params: { fuzzy, page, pageSize, sctime, ectime } })
}
